package com.hwtx.form.domain.repo;

import com.hwtx.form.domain.FormConstants;
import com.hwtx.form.domain.handle.datamodel.DataModel;
import com.hwtx.form.domain.handle.datamodel.DataModelDetail;
import com.hwtx.form.domain.handle.datamodel.DataModelRelate;
import com.hwtx.form.domain.vo.DataModelDetailQuery;
import com.hwtx.form.domain.vo.DataModelQuery;
import io.geekidea.boot.framework.page.Paging;

import java.util.List;

public interface DataModelRepo {
    int saveDetail(DataModelDetail dataModelDetail);

    void saveDetails(List<DataModelDetail> details);

    int saveDataModel(DataModel dataModel);

    List<DataModelDetail> getDetails(String modelName, FormConstants.Status status);

    List<DataModelDetail> getDetails(DataModelDetailQuery query);

    Paging<DataModelDetail> pageDeDetails(int pageIndex, int pageSize, String modelName, FormConstants.Status status);

    Long countDetails(String modelName, FormConstants.Status status);

    @Deprecated
    boolean hasFields(String modelName, Object[] values);

    boolean hasFields(String modelName, String table, Object[] columns);

    DataModelDetail getDetail(Long id);

    boolean deleteDetails(Long id);

    void deleteDetails(String modelName, String table, FormConstants.Status status);

    void deleteDataModel(Long id);

    void deleteRelate(String modelName);

    DataModel getDataModel(String modelName);

    DataModel getDataModel(Long id);

    int updateDataModel(DataModel dataModel);

    int updateDataModelDetailById(DataModelDetail dataModelDetail);

    List<DataModel> getDataModels(DataModelQuery query);

    List<DataModelRelate> getRelates(String modelName);

    void updateDetailModelName(String modelName, String oldModelName);

    void updateDetails(List<DataModelDetail> details);

    void updateRelateModelName(String modelName, String oldModelName);

    int saveRelate(DataModelRelate dataModelRelate);

    int updateRelate(DataModelRelate dataModelRelate);

    DataModelRelate getRelate(Long queryId);

    boolean deleteRelate(Long id);
}
